//
//  SSMineViewCell.m
//  starspaceVR
//
//  Created by 曹端芹 on 17/10/9.
//  Copyright © 2017年 starspace. All rights reserved.
//

#import "SSMineViewCell.h"

@interface SSMineViewCell ()

@property (nonatomic,weak) UIImageView *iconImageView;
@property (nonatomic,weak) UILabel *titleLabel;

@end

@implementation SSMineViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(15, 15));
        make.centerY.mas_equalTo(self.contentView);
        make.left.mas_offset(15);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(45);
        make.height.mas_equalTo(25);
        make.centerY.mas_equalTo(self.contentView);
    }];

}

- (void)setImageName:(NSString *)imageName {
    _imageName = imageName;
    self.iconImageView.image = [UIImage imageNamed:imageName];
}

- (void)setTitle:(NSString *)title {
    _title = title;
    self.titleLabel.text = title;

}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (UIImageView *)iconImageView {
    if (!_iconImageView) {
        UIImageView *imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:imageView];
        _iconImageView = imageView;
    }
    return _iconImageView;
}
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.font = kFont(13);
        label.textColor = kRGBColor(113, 113, 113);
        [self.contentView addSubview:label];
        _titleLabel = label;
    }
    return _titleLabel;
}

@end
